﻿using System;
using System.Text.RegularExpressions;

namespace DHJ.Cost.Excel
{
    [Serializable]
    public class ExcelCell: ExcelCell<object>
    {
    }

    [Serializable]
    public class ExcelCell<TValue>
    {
        public string Cell { get; set; }
        public TValue Value { get; set; }

        public string C => Regex.Replace(Cell, "[0-9]", "", RegexOptions.IgnoreCase);
        public string R => Regex.Replace(Cell, "[A-Z]", "", RegexOptions.IgnoreCase);
    }

    public class ExcelKeyCell: ExcelCell
    {
        public string Key { get; set; }
    }

    public class ExcelHandleItem : ExcelHandleItem<object, object, object>
    {
    }

    public class ExcelHandleItem<TValue> : ExcelHandleItem<TValue, object, object>
    {
    }

    public class ExcelHandleItem<TValue, TRow, TCol>: ExcelCell<TValue>
    {
        public TRow Row { get; set; }
        public TCol Col { get; set; }
    }
}